1. Field of the Invention
The present invention relates to electronic devices driven by rechargeable batteries, methods for controlling the electronic devices, information processing apparatuses, and computer programs. In particular, the present invention relates to an electronic device which can be externally connected to an information processing apparatus, such as a personal computer, and which can be supplied with charging power by the information processing apparatus, and to a method for controlling the electronic device. The present invention also relates to the information processing apparatus and a computer program.
More specifically, the present invention relates to an electronic device which operates as a peripheral device when being externally connected to an information processing apparatus such as a personal computer, and which performs a self-driven operation, and to a method for controlling the electronic device. The present invention also relates to the information processing apparatus and a computer program. In particular, the present invention relates to an electronic device which includes a storage device, such as a hard disk unit, for storing data and content, which operates as an external storage device when being connected to an information processing apparatus such as a personal computer, and which itself can perform data and content processing such as content playback, and to a method for controlling the electronic device. The present invention also relates to the information processing apparatus and a computer program.
2. Description of the Related Art
With current technical innovation, various types of personal computers, such as desktop computers and notebook computers, have been developed and made commercially available. An apparatus of the above type includes an interface for connecting peripheral devices. By using this interface to add on various peripheral devices such as a keyboard, a mouse, a printer, and a modem, the operating environment can be improved and hardware resources can be provided in the apparatus.
Although a serial port, a parallel port, etc., have been known as personal computer interfaces, recently, the Universal Serial Bus (USB) has rapidly become widespread. In addition, USB devices are of various types, such as keyboards, mice, printers, scanners, modems, hard disk drives, CD-RW drives, and DVD drives. USB has features in that a USB cable is relatively thin since USB is a serial bus, that a hub is used to enable tree connection of peripheral devices, and that USB supports various transfer modes. Accordingly, USB is widely recognized as a multi-purpose interface.
Regarding devices connected by USB, devices that are connected by using a USB port or a USB cable are classified into a USB host positioned upstream and USB devices positioned downstream. In other words, a USB host controls a USB device connected thereto by sending a command to the USB device, and the USB device operates as instructed by the USB host. In USB, in addition to data lines (D+, D−), power-supply lines called “VBUS” and “GND” for supplying power from a host to a device are provided.
By using VBUS, power with a maximum current rating of 500 mA can be supplied from a USB host to a USB device. A device that operates by using power supplied from VBUS is called a “USB bus power device”. The current supplied from VBUS is a maximum of 100 mA for a low-power port, and is a maximum of 500 mA for a high-power port.
However, the USB standard has the limitation that, just after connecting a USB device to a USB host through a USB cable, it is necessary for a current for use from VBUS to be 100 mA or greater. In the case of a high-power device that consumes a current (from VBUS) greater than 100 mA, the high-power device operates at a current not greater than 100 mA just after being connected to the USB host. After initial processing called “Configuration” ends and it is confirmed that a port to which the high-power device is connected is a high-power port, the high-power device can consume a current of greater than 500 mA.
By using VBUS, a portable electronic device, such as a cellular phone, can be charged (see, for example, Japanese Unexamined Patent Application Publication Nos. 2000-201204 and 2000-339067). However, among existing high-power devices, there are many devices which only have simple functions such as charging or lighting a lamp, and in which, if at least a current is supplied from VBUS, they use the supplied current, even though they are not recognized as valid USB devices by the USB host. The above devices do not perform a Configuration procedure for the USB host. Thus, although the above devices are connected through a USB cable, the USB host does not recognize them, and thus does not access them. However, they fail to satisfy the USB device standard. When they are connected to a low-power port, they attempt to consume a current greater than the supplying capacity of the port. This may cause a malfunction in the host (hub) and USB devices connected thereto. To prevent this problem, even if they have simple functions such as charging, they need to each have a function of being recognized as a valid USB device.
USB devices include those that have self-driven functions other than functions of operating as peripheral devices of a USB host, such as a personal computer, by using a USB cable. One example of those is a battery-operated portable media player having a built-in hard disk drive.
An electronic device of the above type operates as an external hard disk unit while being connected to a personal computer through a USB cable. When being disconnected from the USB cable (or remaining connected to the USB cable), this electronic device operates as a media player in a stand-alone state and can play back and output content such as video and music on a hard disk.
In addition, the reason that the electronic device of the above type is connected to the USB cable is that it normally operates as a USB device such as a USB hard disk unit, that is, a peripheral device of the personal computer, and that it obtains power necessary in the stand-alone state, that is, it charges its built-in battery by using power obtained from the personal computer through VBUS. In this specification, a state in which an electronic device connected to a USB cable operates as a USB device is called a “normal mode”, and a state in which the electronic device charges a battery after stopping operating as the USB device is called a “charging mode”.
For example, an electronic device (see, for example, Japanese Unexamined Patent Application Publication No. 2003-61256) has been proposed in which, when the electronic device is set as a slave in USB data transfer and is set in the normal operating mode, the electronic device supplies, from a USB power-supply line, power from a power supply or storage battery, or power from an external power supply, to a data transfer control circuit for controlling USB data transfer, and in which, when the electronic device is set as a slave in USB data transfer and is in the charging mode, the electronic device supplies power from the USB power-supply line to the storage battery.
Here, by using a USB hard disk unit as an example, its operation in the charging mode is considered.
In the charging mode, in order to increase charging efficiency, the power of a hard disk drive is turned off and a current supplied through VBUS is supplied not to the hard disk unit but to the rechargeable battery.
After being connected to the USB cable, the hard disk unit serves as a valid USB device to perform a Configuration procedure. Thus, the USB host, such as a personal computer, correctly recognizes the USB hard disk unit as a mass storage unit. Accordingly, the USB host issues various commands such as normal disk accessing for reading from and writing to the hard disk.
However, in the charging mode, it is difficult for the hard disk unit to perform any operation since its power is off. Accordingly, the hard disk unit performs processing such as not responding to commands and sending back an error. If a basic command, such as reading from or writing to the hard disk, is not correctly executed, such a state is treated as a serious defect in the USB host. This results in problems such as inability of the system to respond for seven seconds or longer until time-out of the command, and occurrence of a system malfunction due to serious errors.
When, in the charging mode, a response for the USB hard disk unit is not corrected, a USB device response does not need to be changed in accordance with a mode. Although this eliminates a time to create a USB program for the charging mode, the above problems occur.
To avoid such problems, in the charging mode, when being accessed by the host, the electronic device need not be recognized as having a device malfunction. Accordingly, it is necessary for the USB host to recognize the electronic device as a USB device different from that in the normal mode. In the case of completely different programs (firmware) between the charging mode and the normal mode, the number of steps for development and evaluation increases, and, in addition, a problem occurs, such as the need to increase the size of a memory for storing programs for controlling the USB controller.